-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FullAncillaAllocation for backends witout a coupling map #10240
Conversation
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5222217308
💛 - Coveralls |
@@ -85,6 +85,11 @@ def run(self, dag): | |||
idle_physical_qubits = [ | |||
q for q in self.coupling_map.physical_qubits if q not in physical_bits | |||
] | |||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this branching causes an edge case. When you partly define two qubit gate on your system it will give you imperfect coupling map and you cannot expand the single qubit experiment circuit as you expect. This if-clause should be conditioned on target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nkanazawa1989 can you make a suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant
if self.target:
idle_physical_qubits = [
q for q in range(self.target.num_qubits) if q not in physical_bits
]
elif self.coupling_map:
idle_physical_qubits = [
q for q in self.coupling_map.physical_qubits if q not in physical_bits
]
else:
raise SomeError
By doing this you can always expand circuit to full physical qubits widths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, see change here: f5350b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, thanks for fixing this. I just left some inline suggestions on the release notes formatting and wording. Other than that I think this is ready to merge
releasenotes/notes/ancilla_allocation_no_cmap-ac3ff65b3639988e.yaml
Outdated
Show resolved
Hide resolved
releasenotes/notes/ancilla_allocation_no_cmap-ac3ff65b3639988e.yaml
Outdated
Show resolved
Hide resolved
releasenotes/notes/ancilla_allocation_no_cmap-ac3ff65b3639988e.yaml
Outdated
Show resolved
Hide resolved
releasenotes/notes/ancilla_allocation_no_cmap-ac3ff65b3639988e.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the quick update.
* * Added support for targets without a coupling map. * * Removed restrictive raise. * * Changed order of target and coupling map * Apply suggestions from code review Co-authored-by: Matthew Treinish <mtreinish@kortar.org> --------- Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Summary
The transpiler can transpile to a given target. In some situations there is no coupling map. This can occur at the beginning of device bring-up when the two-qubit gates have not yet been calibrated. In the absence of a coupling map the
FullAncillaAllocation
fails to enlarge the circuit to a number of total qubits that match the number of qubits specified by the target. This PR fixes this behavior.Details and comments
The behavior is fixed by catching the case when coupling map is None. In this case we refer to the number of qubits specified by the target. The test illustrates the desired behavior.